<template>
    <div style="height: 785px;text-align: left">

      <el-row :gutter="0" style="background:white;border-bottom: 1px solid #CCCCCC;margin: -20px;text-align: left;height: 40px;line-height: 40px">
        <el-col :span="24" :offset="0">
          <el-button type="text" @click="goback" style="color: black"><i class="el-icon-arrow-left" ></i>&nbsp;&nbsp;我的额度</el-button>
        </el-col>
      </el-row>

      <el-card class="box-card" style="background: #336699;margin-top: 40px;color: white"><!--#336699-->
        <el-button type="text " style="width: 100%;font-size:20px;margin-top: -15px;color: white" @click="myQuotaDetail">
          <div style="float: left;"><i class="el-icon-s-goods"></i>查看我的额度</div>
          <div style="float: right"><i class="el-icon-arrow-right" style="color: #CCCCCC"></i></div>
        </el-button>
        <br/>


        <div style="margin-top: 15px;color: #CCCCCC">总额度（元）</div>
        <div style="margin-top: 10px;font-size:40px;">{{money1}}</div>
        <el-row :gutter="0" style="margin-top: 40px;">
          <el-col :span="12" :offset="0" style="">
            <div style="color: #CCCCCC;margin-bottom: 5px">可用额度（元）</div>
            <el-button type="text" style="color: white" @click="fun1">{{money2}}&nbsp;&nbsp;<i class="el-icon-arrow-right" style="color: #CCCCCC"></i></el-button>
          </el-col>
          <el-col :span="12" :offset="0" style="">
            <div style="color: #CCCCCC;margin-bottom: 5px">已用额度（元）</div>
            <el-button type="text" style="color: white" @click="fun2">{{money3}}&nbsp;&nbsp;<i class="el-icon-arrow-right" style="color: #CCCCCC"></i></el-button>
          </el-col>
        </el-row>
      </el-card>


    </div>
</template>

<script>
  import axios from  'axios';
    export default {
      name: "myQuota",
      data(){
        return {
          money1:'',
          money2:'5000.00',
          money3:'5000.00',
          paymentStatus:"未还款",
          id:1,
          borrowerId: 1,
        };
      },
      methods: {
   /*     findPartMessagePaymentStatus:function(){
          // alert("shiyan1");
          axios.post("http://localhost:9999/credit-personal/findPartMessagePaymentStatus", {borrowerId:this.borrowerId,paymentStatus:this.paymentStatus}).then(res=>{

            alert("shiyan"+limitnum);
            // this.person=res.data;
             this.limitnum=res.data[0].limitnum;
            console.log(res.data);//控制台数据
          })
        },*/
        //查询个人额度
        findPartMessageById: function (id) {
          axios.post("http://localhost:9999/credit-personal/findPartMessageById", {id: this.id}).then(res => {
            // alert("id" + res.data[0].limitnum);
            this.money1 = res.data[0].limitnum;
            console.log(res.data)
          })
        },
        handleSelect(key, keyPath) {
          console.log(key, keyPath);
        },
        goback:function () {
          this.$router.push("/personal")
        },
        myQuotaDetail:function () {
          this.$router.push("/myQuotaDetail")
        },
        fun1:function () {
          this.$router.push("/borrowReal")
        },
        fun2:function () {
          this.$router.push("/borrowRecord")
        },

      },
      mounted(){
        this.findPartMessageById(1);/*this.$route.params.id*/
        // this.findPartMessagePaymentStatus(1,"已还款");//id,paymentStatus
      }
    }
</script>

<style scoped>

</style>
